﻿package bacIns.exchangeddata 
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import game.constants.ConstData;
	import game.events.EventData;
	/**
	 * ...
	 * @author Nguyen Thi Bich Phuong (Daisy)
	 */
	public class BacUserLiveBetPoolInfo extends EventDispatcher {		
		public var numBanker:int = 0;
		public var numPlayer:int = 0;
		public var numTie:int = 0;
		public var numBankerPair:int = 0;
		public var numPlayerPair:int = 0;
		public var numBig:int = 0;
		public var numSmall:int = 0;
		
		public function BacUserLiveBetPoolInfo() {}		
		
		public function resetValue():void {
			this.numBanker = 0;
			this.numPlayer = 0;
			this.numTie = 0;			
			this.numBankerPair = 0;
			this.numPlayerPair = 0;
			this.numBig = 0;
			this.numSmall = 0;
		}
		
		public function returnCurrentBetPool(result:String):void {				
			var pos:int = ConstData.POS_LBPUSER_PUBLIC;
			this.numBanker = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numPlayer = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numTie = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numBankerPair =  parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numPlayerPair = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numBig = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			pos += ConstData.LEN_LBPUSER_PUBLIC;
			this.numSmall = parseInt(result.substr(pos, ConstData.LEN_LBPUSER_PUBLIC), 10);
			//pos += ConstData.LEN_LBPUSER_PUBLIC;		
			dispatchEvent(new Event(EventData.UPDATE_LIVEBETPOOL_USER_PUBLIC, true));
		}
	}
}